package com.lzycug.server;

import com.lzycug.utils.ConfigUtil;

import java.util.Arrays;
import java.util.List;

/**
 * 生产者，初始化号源信息
 */
public class Producer {
    public static void main(String[] args) {
        int clientCount = Integer.parseInt(ConfigUtil.getProperty("bank.server.client"));
        String serverStr = ConfigUtil.getProperty("bank.server.list");
        List<String> serverList = Arrays.asList(serverStr.split(","));

        for (int i = 1; i <= clientCount; i++) {
            new Consumer(serverList.get(i % 2), String.valueOf(i)).start();
        }
    }
}